﻿using System;
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Reflection;
using System.Text;
using Microsoft.CSharp;
using MockFramework.CompilerServices;
using MockFramework.ControlServices;
using MockFramework.DataModels;

namespace MockFramework
{
    public class Mock<T>
    {
        public T Object { get; set; }
        public Type _declaredType { get; set; }
        private Boolean _hasExpectations = true;

        public Mock()
        {
            // obter o Type de T
            _declaredType = typeof(T);

            if (_declaredType.IsInterface)
                Console.WriteLine("Eu sou do tipo Interface");
            else if (_declaredType.IsAbstract)
                Console.WriteLine("Eu sou do tipo Abstract");
            else Console.WriteLine("Eu sou do tipo Classe");

            Proxy proxyClass = ManageProxyClasses.DefineProxyClass(_declaredType);
            
            // avaliar se é interface
            // gerar dinamicamente classe derivada e implementar interface)
            
            if (!_hasExpectations)
                throw new NotSupportedException("Sem expectations aplicaveis");
        }

        public void SetupProperty(Func<object, object> p0, string foo)
        {
            throw new NotImplementedException();
        }

        public void Setup(Expression<Func<T, T>> tree)
        {
            throw new NotImplementedException();
        }

        //public T Setup(Expression<Func<T, TResult>> tree)
        //{
        //    throw new NotImplementedException();
        //}

        //public void Raise(Expression<Func<T, TResult>> tree)
        //{
        //    throw new NotImplementedException();
        //}

        //public bool Returns(Expression<Func<T, TResult>> tree)
        //{
        //    throw new NotImplementedException();
        //}

        //public T SetupGet(Func<object, object> func)
        //{
        //    throw new NotImplementedException();
        //}

        

    }
}
